// 初始化按钮状态

export default function updateButtonStatus() {
    const {orgVal, pageInfo, disabledAll, queryModel} = this.state;
    const flag = !parseInt(pageInfo.total) || disabledAll;
    this.props.button.setButtonVisible({
        addline: queryModel === '1',
        add: queryModel === '1'
    });

    this.props.button.setButtonDisabled({
        add: !orgVal.refpk || disabledAll,
        query: !orgVal.refpk || disabledAll,
        refresh: !orgVal.refpk || disabledAll,
        sort: flag || disabledAll,
        batchedit: flag,
        print: flag,
        output: flag,
    });
}
